package hibernate2;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Table(name = "player_login")
@Entity
public class PlayerLogin {
	

	public PlayerLogin() {
		super();
	}

	public PlayerLogin(int id, String username, String password, Player player, int player_status) {
		super();
		this.id = id;
		this.username = username;
		this.password = password;
		this.player = player;
		this.player_status = player_status;
	}

	public int getPlayer_status() {
		return player_status;
	}

	public void setPlayer_status(int player_status) {
		this.player_status = player_status;
	}

	@Override
	public String toString() {
		return "PlayerLogin [id=" + id + ", username=" + username + ", password=" + password + ", player=" + player
				+ "]";
	}

	@Id
	@Column(name = "id")
	private int id;

	@Column(name = "username")
	private String username;

	@Column(name = "password")
	private String password;
	
	@OneToOne(mappedBy="player_login")
	private Player player;
	
	private int player_status;

	public Player getPlayer() {
		return player;
	}

	public void setPlayer(Player player) {
		this.player = player;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

}
